//
//  DECXUser.m
//  DECXInStore
//
//  Created by 程强 on 15/12/14.
//  Copyright © 2015年 程强. All rights reserved.
//

#import "DECXUser.h"

@implementation DECXUser
- (instancetype)initWithResponse:(NSDictionary *)dic
{
    if (self = [super init]) {
        self.userid = ValidString(dic[@"id"]);
        self.name = ValidString(dic[@"name"]);
        self.mobile = ValidString(dic[@"mobile"]);
        self.phone = ValidString(dic[@"phone"]);
        self.email = ValidString(dic[@"email"]);
        self.depot_id = ValidString(dic[@"depot_id"]);
        self.depot_addr = ValidString(dic[@"depot_addr"]);
        self.level = ValidString(dic[@"level"]);
    }
    return self;
}
- (instancetype)initWithOneKeyResponse:(NSDictionary *)dic
{
    if (self = [super init]) {
        self.userid = ValidString(dic[@"user_id"]);
        self.name = ValidString(dic[@"user_tname"]);
        self.mobile = ValidString(dic[@"user_phone"]);
        self.seat = [NSString stringWithFormat:@"%@",dic[@"user_seat"]];
        self.type = ValidString(dic[@"user_type"]);
    }
    return self;
}
@end
